﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Colorful.Control.Converters;
using System.Globalization;
using System.Windows;

namespace Colorful.Test.Unit
{
    [TestClass]
    public class IntRangeToVisibilityConverterTest
    {
        public IntRangeToVisibilityConverterTest()
        {
        }
     
        [TestMethod]
        public void ShouldBeVisibleTest()
        {
            var converter = new IntRangeToVisibilityConverter();
            Visibility expected = Visibility.Visible;

            Assert.AreEqual<Visibility>(expected, (Visibility)converter.Convert(1, typeof(Int32), 1, CultureInfo.CurrentCulture));
            Assert.AreEqual<Visibility>(expected, (Visibility)converter.Convert(2, typeof(Int32), 2, CultureInfo.CurrentCulture));
            Assert.AreEqual<Visibility>(expected, (Visibility)converter.Convert(3, typeof(Int32), 3, CultureInfo.CurrentCulture));
            Assert.AreEqual<Visibility>(expected, (Visibility)converter.Convert(4, typeof(Int32), 4, CultureInfo.CurrentCulture));
            Assert.AreEqual<Visibility>(expected, (Visibility)converter.Convert(5, typeof(Int32), 5, CultureInfo.CurrentCulture));
        }

        [TestMethod]
        public void ShouldBeInvisibleTest()
        {
            var converter = new IntRangeToVisibilityConverter();
            Visibility expected = Visibility.Collapsed;

            Assert.AreEqual<Visibility>(expected, (Visibility)converter.Convert(0, typeof(Int32), 1, CultureInfo.CurrentCulture));
            Assert.AreEqual<Visibility>(expected, (Visibility)converter.Convert(1, typeof(Int32), 2, CultureInfo.CurrentCulture));
            Assert.AreEqual<Visibility>(expected, (Visibility)converter.Convert(2, typeof(Int32), 3, CultureInfo.CurrentCulture));
            Assert.AreEqual<Visibility>(expected, (Visibility)converter.Convert(3, typeof(Int32), 4, CultureInfo.CurrentCulture));
            Assert.AreEqual<Visibility>(expected, (Visibility)converter.Convert(4, typeof(Int32), 5, CultureInfo.CurrentCulture));
        }
    }
}
